<%@ taglib prefix="spring" 	uri="http://www.springframework.org/tags"  %>
<%@ taglib prefix="c" 		uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" 	uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" 		uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="form" 	uri="http://www.springframework.org/tags/form" %>
<%@ taglib tagdir="/WEB-INF/tags/component" prefix="component" %>
<%@ taglib uri="/WEB-INF/tlds/DataTableTags.tld" prefix="customCom" %>

<%
	if (session.getAttribute("uiTheme") == null)
		session.setAttribute("uiTheme", "redmond");
%>
<%
	request.setAttribute("jsession_id", request.getSession().getId());
%>
<%
	String selectedValue = request.getParameter("locale");
	if (selectedValue != null && !selectedValue.equals("")) {
		request.getSession().setAttribute("lang", selectedValue);
	}

	String selectedLang = null;
	if (request.getSession().getAttribute("lang") != null) {
		selectedLang = request.getSession().getAttribute("lang")
				.toString();
	}
%>


<div align="right">
	<form name="langform" action="" method="get">
		<select id="locale" name="locale"
			onchange="document.forms['langform'].submit();">
			<%
				if (selectedLang != null && selectedLang.equalsIgnoreCase("en_US")) {
			%>
			<option value='en_US' selected='selected'><spring:message code="sp.topmenu.language.english" /></option>
			<%
				} else {
			%>
			<option value='en_US' ><spring:message code="sp.topmenu.language.english" /></option>
			<%
				}
				;
				if (selectedLang != null && selectedLang.equalsIgnoreCase("ur")) {
			%>
			<option value='ur' selected='selected'><spring:message code="sp.topmenu.language.urdu" /></option>
			<%
			   } else {
			%>
			<option value='ur'><spring:message code="sp.topmenu.language.urdu" /></option>
			<%
				}
				;
				if (selectedLang != null && selectedLang.equalsIgnoreCase("fr_FR")) {
			%>
			<option value='fr_FR' selected='selected'><spring:message code="sp.topmenu.language.french" /></option>
			<%
				} else {
			%>
			<option value='fr_FR' ><spring:message code="sp.topmenu.language.french" /></option>
			<%
				}	
				
			%>

		</select>
		<input type="submit" class='ui-button ui-state-default ui-corner-all' value='<spring:message code="sp.topmenu.button.changelanguage" />'/>
	</form>
	<!-- <a href="?locale=en">en</a> | <a href="?locale=fr">fr</a> -->
</div>